fix(commands): resolve --assignee to UUID in issues create/update#50
Merged
Conversation
Resolves user identifiers (display name, email, or UUID) to UUIDs via the Linear SDK, following the same pattern as existing resolvers. Lookup order: UUID passthrough → display name (case-insensitive) → email (case-insensitive). Throws multipleMatchesError when name is ambiguous, notFoundError when no match exists. Closes #47 Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
The --assignee option was passed directly to assigneeId without resolution, causing GraphQL validation errors when given a name or email instead of a UUID. Wire both create and update through the new resolveUserId resolver. Closes #47 Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
Add command-level tests that drive the CLI through Commander and verify resolveUserId is called with the correct input and its result flows into the service layer. Covers create with name, create with email, update with name, and omitted-assignee cases. Co-Authored-By: claude-opus-4-6 <noreply@anthropic.com>
iamfj
added a commit
that referenced
this pull request
Apr 7, 2026
Replace the flat utils-based structure with a strict five-layer architecture enforcing separation of concerns: CLI Input → Command → Resolver → Service → JSON Output Clients: - GraphQLClient: typed wrapper for raw GraphQL operations - LinearSdkClient: wrapper for Linear SDK access Common modules: - context: CommandContext factory with createContext() - errors: structured error helpers (notFoundError, etc.) - identifier: UUID detection and identifier parsing - output: typed outputSuccess/outputError functions - types: shared type aliases derived from codegen types - usage: DomainMeta system for self-documenting commands Resolvers (human ID → UUID, using LinearSdkClient): - team, project, label, status, issue, cycle, milestone, user Services (business logic, using GraphQLClient): - issue, document, attachment, file, comment, cycle, milestone, project, team, user, label, issue-relation, auth Commands rewritten to delegate through layers: - Rename embeds → files, project-milestones → milestones - Merge search into list commands - Add issue relation flags (--blocks, --blocked-by, --relates-to) - Add cursor pagination (--after, --limit) to all list commands - Add --assignee resolution by name or email - Add encrypted token auth (login, status, logout) - Add usage subcommand to every command group Remove old utils/, queries/ directories and their tests. Add comprehensive unit tests for all resolvers and services. Closes #27, closes #43, closes #47 Refs #2, #3, #14, #16 Part of #45, incorporates #50, #53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fix for
--assigneeoption onissues createandissues updatefailing with a GraphQL validation error when given a human-friendly name or email instead of a UUID.Problem
The
--assigneevalue was passed directly toinput.assigneeIdwithout resolution. Every other identifier option (--team,--project,--labels,--cycle,--status,--parent-ticket,--project-milestone) goes through a dedicated resolver, but--assigneewas missing one, causing:{"error": "GraphQL request failed: Argument Validation Error - assigneeId must be a UUID."}Solution
resolveUserId()resolver (src/resolvers/user-resolver.ts) usingLinearSdkClient, following the established resolver patternmultipleMatchesErrorwhen name is ambiguous,notFoundErrorwhen no match existsissues createandissues updatecommandsTesting
resolveUserIdis called with correct args and its UUID flows intocreateIssue/updateIssuefor both name and email inputs, plus omitted-assignee casesChecklist
Closes #47